import yaml


class TestConfigRead:
    # 姓名
    MY_NAME = "唐磊"
    # 用户名 工号
    USERNAME = 80007380
    # 密码
    PASSWORD = 'z3mDy8aYdhtACzagcGlXZw=='

    @staticmethod
    def readConfig():
        with open('config.yaml', 'r', encoding='utf-8') as f:
            return yaml.load(f.read(), Loader=yaml.FullLoader)  # 其返回一个字典数据

    @classmethod
    def configClassField(self):
        config = TestConfigRead.readConfig()
        self.MY_NAME = config.get('MY_NAME')
        self.USERNAME = config.get('USERNAME')
        self.PASSWORD = config.get('PASSWORD')

if __name__ == '__main__':
    config = TestConfigRead()
    config.configClassField()
    print(config.MY_NAME)




